package cn.com.hbhgkj.model;

import java.io.Serializable;
import java.util.Locale;

import org.apache.commons.lang3.StringUtils;


public class Copyrighter extends BaseObject implements Serializable {
	private String peopleType;

	private String country;
	private String name;
	private String province;
	private String city;
	private String idType;
	private String idNumber;
	private String garden;
	private String busType;
	
	public Copyrighter(){
		this.peopleType = "";
		this.country = "";
		this.name = "";
		this.province = "";
		this.city = "";
		this.idType = "";
		this.idNumber = "";
		this.garden = "";
		this.busType = "";
	}
	
	/*private CopyrightApplication copyrightApplication;

	@ManyToOne
	@JoinColumn(name="ca_id")
	public CopyrightApplication getCopyrightApplication() {
		return copyrightApplication;
	}

	public void setCopyrightApplication(CopyrightApplication copyrightApplication) {
		this.copyrightApplication = copyrightApplication;
	}
*/

	public String getPeopleType() {
		return peopleType;
	}

	public void setPeopleType(String peopleType) {
		this.peopleType = peopleType;
	}
	
	public String getCountry() {
		if(StringUtils.isEmpty(this.country))
			return "CN";
		
		for(Locale each : Locale.getAvailableLocales()){
    		if(each.getDisplayCountry().equals(this.country)){
    			return each.getCountry();
    		}
    	}
        return "";
	}
	

	public void setCountry(String country) {
		Locale l = new Locale("",country);
        this.country = l.getDisplayCountry();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getIdType() {
		if(StringUtils.isEmpty(idType))
			return "5";
		return idType;
	}

	public void setIdType(String idType) {
		this.idType = idType;
	}

	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}

	public String getGarden() {
		return garden;
	}

	public void setGarden(String garden) {
		this.garden = garden;
	}

	public String getBusType() {
		return busType;
	}

	public void setBusType(String busType) {
		this.busType = busType;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "Copyrighter";
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
            return true;
        }
        if (!(o instanceof Copyrighter)) {
            return false;
        }

        final Copyrighter copyrighter = (Copyrighter) o;

        return !(name != null ? !name.equals(copyrighter.getName()) : copyrighter.getName() != null);
	}

	@Override
	public int hashCode() {
		return (name != null ? name.hashCode() : 0);
	}
	
	
	public static void main(String[] agrs){
		for(Locale each : Locale.getAvailableLocales()){
			System.out.println(each.getCountry());
    	}
		
		
	}

}
